import Search from "antd/es/transfer/search";
import { useEffect, useState, useRef } from "react";
import { useParams, useSearchParams } from "react-router-dom";
import { useLocation } from "react-router-dom";
export const useRouteParams = (keyWord: string): string => {
  var [searchWord, setSearchWord] = useState("");
  const location = useLocation();
  let queryParams = new URLSearchParams(location.search);
  useEffect(() => {
    console.log("当前路由参数改变啦");
  }, [location, keyWord]);
  return queryParams.get(keyWord) || "";
};
